#include <stdio.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <rpc/rpc.h>
#include <unistd.h>



#define PROGNUM 0x20000100
#define VERSNUM 1
#define PROCNUM 1



int main (int argc, char **argv) 
{
  	int res = 0,  n; 
  	char *host ;
  	enum clnt_stat stat ;

  	if (argc != 3) 
  	{
    	printf("Usage: %s server_location number\n",argv[0]);
   	 exit(0);
  	}
  
  	n = atoi(argv[2]);
  
  	host = argv[1];

	printf("appel %d\n", n);

  	stat = callrpc(/* host */ host,
		 /* prognum */ PROGNUM,
		 /* versnum */ VERSNUM,
		 /* procnum */ PROCNUM,
		 /* argument encoding filter */ (xdrproc_t) xdr_int,
		 /* argument */ (char *)&n,
		 /* return value decoding filter */ (xdrproc_t)xdr_int,
		 /* retour value */(char *)&res);

	printf("fait %d\n",n);

  	return 0;
}



